{% macro pagination_widget(pagination, url) %}

<nav>
    <ul class="pagination pagination-circle">
        <!--        如果点击上一页-->
        {% if pagination.has_prev %}
        <li class="disabled">
            <a href="{{ url_for(url,page=pagination.page-1) }}">
                <span><i class="mdi mdi-chevron-left"></i></span>
            </a>
        </li>
        {% else %}
        <li class="disabled">
            <a href="#">
                <span><i class="mdi mdi-chevron-left"></i></span>
            </a>
        </li>
        {% endif %}

<!--        显示的页数-->
        {% for v in pagination.iter_pages() %}
            {% if v == pagination.page %}
                <li class="active"><a href="#">{{ v }}</a></li>
            {% else %}
                <li><a href="{{ url_for(url,page=v) }}">{{ v }}</a></li>
            {% endif %}
        {% endfor %}


<!--        点击下一页-->
        {% if pagination.has_next %}
        <li><a href="{{ url_for(url,page=pagination.page+1) }}">下一页</a></li>
        {% else %}
        <li>
            <a href="#">
                <span><i class="mdi mdi-chevron-right"></i></span>
            </a>
        </li>
        {% endif %}
    </ul>
</nav>

{%endmacro%}